define(["app"], function(app) {
	var deps = ["$http", "BaseService"];
	
	function resource($http, BaseService) {
		return initSuiteResource($http,BaseService.restfulUrl + "suite/", BaseService.formHeader);
	}
	var postHeader = {
			"Content-Type" : "application/x-www-form-urlencoded;charset=utf-8"
	};
	function initSuiteResource($http,suiteUrl, headers){
		return {
			querySuites : function(pageNo, pageSize){	
				return $http.get(suiteUrl+'querySuites',{
					params: {
                        pageNo: pageNo || 1,
                        pageSize: pageSize || 10,
                        requestType:1
                    }
				});
			},
			saveSuite:function(suite){
				return $http.post(suiteUrl + "saveSuite", angular.toJson(suite));
			},
			updateSuite:function(suite){
				return $http.post(suiteUrl + "updateSuite", angular.toJson(suite));
			},
			getSuiteById:function(suitekey){
                return $http.get(suiteUrl+"getSuiteById",{
                    params:{
                    	suitekey:suitekey
                    }
                });
            }
		};
	}
	resource.$inject = deps;
	app.lazy.factory("SuiteResource", resource);
});
